#pragma once
#include <oslib/oslib.h>
#include <string>
#include <stdio.h>

#define BCK_IMG_PATH "bkg.png"
#define PSP_SCREEN_WIDTH 480
#define PSP_SCREEN_HEIGHT 272
#define MAX_COMP_NUM 100
#define MAX_CANV_NUM 50

static int _uicount = 0;
static OSL_FONT *oftFont, *latinFont, *jpFont;

enum colors {
    RED =   0xFF0000FF,
    GREEN = 0xFF00FF00,
    BLUE =  0xFFFF0000,
    WHITE = 0xFFFFFFFF,
    LITEGRAY = 0xFFBFBFBF,
    GRAY =  0xFF7F7F7F,
    DARKGRAY = 0xFF3F3F3F,
    BLACK = 0xFF000000
};

class UIComponent{
    public:
        int downloadable;
        int runnable;
        int state; // 0 base 1 hovered 2 selected
        int percent;
        UIComponent();
        ~UIComponent();
        virtual void draw();
        virtual void onselect();
        virtual void onblur();
        virtual void onhover();
    protected:
        int _uid;
        int _x;
        int _y;
        int _width;
        int _height;
        OSL_FONT *font,*latinfont,*jpfont;
};
